import { defineNuxtPlugin } from "#app";
import { createI18n } from "vue-i18n";
import en from "@/assets/lang/en";
const messages = {
  en
};

const I18nConfig = {
  locale: "en",
  messages
};

const create = () => createI18n(I18nConfig);
// eslint-disable-next-line @typescript-eslint/ban-types
export type I18nInst = ReturnType<typeof create>;

export default defineNuxtPlugin(app => {
  const i18n = create();
  app.vueApp.use(i18n);
  app.provide("i18n", i18n.global);
});
